function a(a, e, o) {
    return e in a ? Object.defineProperty(a, e, {
        value: o,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : a[e] = o, a;
}

var e = require("../../utils/api.js"), o = require("../../utils/disapi.js"), t = getApp();

Page({
    data: {
        nickname: "",
        money: "",
        used_money: "",
        photo: "",
        cash_num: 0,
        chil: 0,
        order: 0,
        openid: "",
        cash_money: "",
        showLoding: !1,
        message: "",
        maxmoney: 0
    },
    onLoad: function(n) {
        (s = this).setData({
            showLoding: !s.data.showLoding
        }), wx.setNavigationBarColor({
            frontColor: wx.getStorageSync("basic").topcolor,
            backgroundColor: wx.getStorageSync("basic").topbg
        });
        var d = t.globalData.openid, s = this;
        e.getTeamOpenid({
            openid: t.globalData.openid
        }).then(function(e) {
            console.log(e.data.head), s.setData({
                headinfo: e.data.head_info,
                userinfo: e.data.user,
                openid: d
            });
            var n = e.data.head_info.m_id + "#" + e.data.user.m_id;
            console.log(n), o.get_dis_user_info({
                openid: t.globalData.openid,
                scene: n
            }).then(function(e) {
                if (console.log(e), 2 == e.errno) return wx.redirectTo({
                    url: "/pages/commission/register/index?stauts=2"
                }), !1;
                if (4 == e.errno) return wx.redirectTo({
                    url: "/pages/commission/register/index?stauts=4"
                }), !1;
                3 == e.errno && wx.showModal({
                    title: "账号已被冻结",
                    content: e.message,
                    showCancel: !1,
                    success: function(a) {
                        if (a.confirm) return wx.redirectTo({
                            url: "/pages/personal/personal"
                        }), !1;
                    },
                    complete: function() {
                        s.setData({
                            showLoding: !s.data.showLoding
                        });
                    }
                });
                var o = e.data;
                if (0 == o.code) {
                    parseFloat(parseFloat(o.data.used_mondey) + parseFloat(o.data.money) + parseFloat(o.data.cash_money)).toFixed(2);
                    var t, n = parseFloat(parseFloat(e.data.data.used_mondey) + parseFloat(e.data.data.cash_money) + parseFloat(e.data.data.money)).toFixed(2), d = parseFloat(parseFloat(e.data.data.money) - parseFloat(e.data.data.cash_money)).toFixed(2);
                    s.setData((t = {
                        nickname: o.data.m_nickname,
                        used_money: parseFloat(o.data.used_mondey),
                        money: parseFloat(o.data.money),
                        photo: o.data.m_photo,
                        cash_num: parseInt(o.data.cash_num),
                        chil: parseInt(o.data.chil),
                        cash_money: parseFloat(o.data.cash_money),
                        codeImg: e.data.data.code_img,
                        codeNum: e.data.data.code_num,
                        posterBg: e.data.data.img,
                        rotate: !1,
                        moneyInfo: e.data
                    }, a(t, "nickname", o.data.m_nickname), a(t, "allMoney", parseFloat(e.data.data.money_total).toFixed(2)), 
                    a(t, "allCommission", n), a(t, "showLoding", !0), a(t, "canGet", d), t));
                }
            });
        }), e.markrting({
            op: "distribution_recharge",
            openid: t.globalData.openid
        }).then(function(a) {
            console.log(a), 1 == a.code && s.setData({
                rechargeInfo: a.data.data
            });
        }), o.get_dis_corder_num({
            openid: this.data.openid
        }).then(function(a) {
            if (console.log(a), 0 == a.errno) {
                var e = a.data;
                console.log(e), 0 == e.code && s.setData({
                    order: e.data.order
                });
            }
            s.setData({
                showLoding: !s.data.showLoding
            });
        }), setTimeout(function() {
            s.setData({
                rotate: !1
            });
        }, 1e3);
    },
    rotate: function() {
        var a = this;
        a.setData({
            rotate: !0
        }), a.onLoad();
    }
});